package cn.xbest.rabbitmq.study.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class Receiver {

    @RabbitListener(queues = "队列一")
    public void receive1(String message){
        log.info("队列一收到："+message);
    }

    @RabbitListener(queues = "队列二")
    public void receive2(String message){
        log.info("队列二收到："+message);
    }
    @RabbitListener(queues = "我是路由队列一的消息")
    public void receive3(String msg) {
        log.info("jsd2211 :"+msg);
    }
    @RabbitListener(queues = "我是路由队列二的消息")
    public void receive4(String msg) {
        log.info("cgb2211:"+msg);
    }
    @RabbitListener(queues = "我是主题队列一的消息")
    public void receive5(String msg) {
        log.info("主题队列一收到的消息 :"+msg);
    }
    @RabbitListener(queues = "我是主题队列二的消息")
    public void receive6(String msg) {
        log.info("主题队列二收到的消息:"+msg);
    }
}

